package com.hpf.lease.web.admin.controller;

import com.hpf.lease.common.result.Result;
import com.hpf.lease.web.admin.service.FileService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;

@RequestMapping("/admin/file")
@Tag(name = "文件管理模块")
public class FileController {
    @Resource
    FileService fileService;
    @PostMapping("/upload")
    @Operation(summary = "文件上传")
    public Result<Object> upload(@RequestParam("file")MultipartFile file){
        return Result.build(fileService.upload(file));
    }
}
